package cn.bdqn.activity01;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class OneActivity extends AppCompatActivity implements View.OnClickListener {
    private static  final String TAG="one__iactivity";
    private Button btn_one;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_one);
        Log.i(TAG,"实例化");
        btn_one=findViewById(R.id.btn_one);
    }
    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG,"启动");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG,"交互");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG,"挂起");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG,"停止");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG,"重启");
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "销毁");
    }

    //交互实现的方式
    @Override
    public void onClick(View v) {
        Intent intent=new Intent(OneActivity.this,twoActivity.class);
        intent.putExtra("msg","哈哈");//绑定数据
        intent.putExtra("num","88");
        startActivity(intent);
    }
}
